| Conditions | 3 |
| Total Lines | 18 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | import { spawn, execSync } from 'child_process'; |
||
| 9 | async function main() { |
||
| 10 | const { platform, versions } = process; |
||
| 11 | |||
| 12 | console.log(JSON.stringify({ platform, versions })); |
||
|
|
|||
| 13 | const packageJSON = await fs.readJSON(path.join(process.cwd(), 'package.json')); |
||
| 14 | const config = packageJSON['node-package-tester']; |
||
| 15 | const testCommand = getTestCommand(config, { platform, versions }); |
||
| 16 | const prepareCommands = getPrepareCommands(config, { platform, versions }); |
||
| 17 | |||
| 18 | console.log('prepareCommands:', prepareCommands); |
||
| 19 | for (const prepareCommand of prepareCommands) { |
||
| 20 | execSync(prepareCommand); |
||
| 21 | } |
||
| 22 | |||
| 23 | const childProcess = spawn('npm', [ 'run', testCommand ], { shell: true, stdio: 'inherit' }); |
||
| 24 | |||
| 25 | childProcess.on('exit', (code) => process.exit(code)); |
||
| 26 | } |
||
| 27 | |||
| 30 |